package com.kaifamiao.month05.day19;

public class Test1 {

    // 利用递归计算5！
    public static void main(String[] args) {
        System.out.println(multiple(5));
    }

    // 5! = 5 * 4!
    // 4! = 4 * 3!
    public static int multiple(int num) {
        if (num == 0 || num == 1) {
            return 1;
        }
        return num * multiple(num - 1);
    }
}
